<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户面信令分析报告</title>
    <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
    <style>
* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            overflow-x: hidden;
        }

        .main-container {
            display: flex;
            min-height: 100vh;
        }

        .main-content {
            flex: 1;
            padding: 20px;
            transition: margin-right 0.3s ease;
        }

        .main-content.expanded {
            margin-right: 500px;
        }

        .header {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            text-align: center;
        }

        .header h1 {
            color: #2c3e50;
            font-size: 2.5em;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        .header .subtitle {
            color: #7f8c8d;
            font-size: 1.2em;
            margin-bottom: 20px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 10px;
            padding: 15px;
            text-align: center;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-3px);
        }

        .stat-number {
            font-size: 2em;
            font-weight: bold;
            color: #3498db;
            margin-bottom: 5px;
        }

        .stat-label {
            color: #7f8c8d;
            font-size: 0.9em;
        }

        .analysis-section {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .analysis-section h2 {
            color: #2c3e50;
            font-size: 1.8em;
            margin-bottom: 20px;
            border-bottom: 3px solid #3498db;
            padding-bottom: 10px;
        }

        .flows-container, .anomalies-container, .statistics-container, .signaling-flow-container {
            margin-top: 20px;
        }

        .flow-item, .anomaly-item {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            margin: 10px 0;
            border-left: 4px solid #3498db;
        }

        .flow-item h4, .anomaly-item h4 {
            color: #2c3e50;
            margin-bottom: 10px;
        }

        .flow-details p {
            margin: 5px 0;
            color: #7f8c8d;
        }

        .protocol-chart {
            margin: 20px 0;
        }

        .protocol-bar {
            display: flex;
            align-items: center;
            margin: 10px 0;
            gap: 10px;
        }

        .protocol-bar .bar {
            height: 20px;
            background: linear-gradient(90deg, #3498db, #2980b9);
            border-radius: 10px;
            min-width: 50px;
        }

        .mermaid-diagram {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 20px;
            margin: 20px 0;
        }

        .signaling-flow-diagram {
            background: #2c3e50;
            border-radius: 15px;
            padding: 30px;
            margin: 20px 0;
            color: white;
        }

        .flow-chart {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .flow-chart .flow-item {
            text-align: center;
            width: 100%;
            max-width: 600px;
            background: transparent;
            border-left: none;
            padding: 0;
            margin: 0;
        }

        .flow-header {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 15px;
            font-weight: bold;
            font-size: 1.1em;
            color: white;
        }

        .flow-arrow {
            font-size: 1.5em;
            color: #3498db;
            margin: 10px 0;
        }

        .flow-details {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            padding: 15px;
            margin: 10px 0;
        }

        .flow-branch {
            text-align: left;
            margin: 5px 0;
            padding: 5px 0;
            color: white;
        }

        .flow-branch.anomaly {
            color: #e74c3c;
            font-weight: bold;
        }

        .anomaly-summary {
            background: rgba(231, 76, 60, 0.1);
            border-radius: 8px;
            padding: 20px;
            margin-top: 20px;
        }

        .anomaly-summary h4 {
            color: #e74c3c;
            margin-bottom: 15px;
        }

        .anomaly-summary .anomaly-item {
            margin: 8px 0;
            padding: 5px 0;
            color: white;
            background: transparent;
            border-left: none;
        }

        .signal-element-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 20px;
        }

        .signal-element-panel {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            border-left: 4px solid #3498db;
        }

        .signal-element-item {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .checkmark {
            font-size: 1.2em;
            color: #27ae60;
        }

        .element-text {
            font-weight: bold;
            color: #2c3e50;
        }

        .status-text {
            color: #27ae60;
            font-weight: bold;
        }

        .verification-conclusion {
            background: #e3f2fd;
            border-radius: 8px;
            padding: 20px;
            margin-top: 15px;
        }

        .verification-conclusion h5 {
            color: #1976d2;
            margin-bottom: 10px;
        }

        .verification-conclusion p {
            color: #2c3e50;
            line-height: 1.6;
        }

        .flow-phases {
            margin-top: 30px;
        }

        .phase-analysis {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }

        .phase-item {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            border-left: 4px solid #3498db;
        }

        .sidebar {
            position: fixed;
            right: 0;
            top: 0;
            width: 500px;
            height: 100vh;
            background: rgba(255, 255, 255, 0.98);
            box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
            overflow-y: auto;
            transition: transform 0.3s ease;
            z-index: 1000;
        }

        .sidebar.collapsed {
            transform: translateX(100%);
        }

        .sidebar-toggle {
            position: fixed;
            right: 20px;
            top: 20px;
            background: #3498db;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1em;
            z-index: 1001;
            transition: background 0.3s ease;
        }

        .sidebar-toggle:hover {
            background: #2980b9;
        }

        .sidebar-header {
            background: #2c3e50;
            color: white;
            padding: 20px;
            text-align: center;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .sidebar-content {
            padding: 20px;
        }

        .sidebar-section {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            border-left: 4px solid #3498db;
        }

        .sidebar-section h4 {
            color: #2c3e50;
            font-size: 1.2em;
            margin-bottom: 15px;
            border-bottom: 2px solid #3498db;
            padding-bottom: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            word-wrap: break-word;
            word-break: break-all;
        }

        .section-toggle {
            background: none;
            border: none;
            color: #3498db;
            font-size: 1.2em;
            cursor: pointer;
            padding: 0;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .section-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
            word-wrap: break-word;
            word-break: break-all;
            line-height: 1.4;
        }

        .section-content.expanded {
            max-height: 2000px;
        }

        .sub-section {
            background: #e0e0e0;
            border-radius: 6px;
            padding: 10px 15px;
            margin-bottom: 10px;
            border-left: 3px solid #3498db;
        }

        .sub-item {
            color: #2c3e50;
            font-size: 1em;
            margin-bottom: 5px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 5px 0;
        }

        .sub-item .sub-toggle {
            font-size: 0.8em;
            color: #7f8c8d;
            transition: transform 0.3s ease;
        }

        .sub-item:hover .sub-toggle {
            transform: rotate(90deg);
        }

        .sub-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
            padding-left: 20px;
            word-wrap: break-word;
            word-break: break-all;
            line-height: 1.4;
        }

        .sub-content.expanded {
            max-height: 2000px;
        }

        .recommendation-item, .key-anomaly-item, .field-check-item, .solution-item {
            background: #ffffff;
            border-radius: 8px;
            padding: 15px;
            margin: 10px 0;
            border-left: 4px solid #f39c12;
        }

        .recommendation-item h5, .key-anomaly-item h5 {
            color: #2c3e50;
            margin-bottom: 10px;
        }

        .export-btn {
            background: #3498db;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9em;
            margin: 5px;
            transition: background 0.3s ease;
        }

        .export-btn:hover {
            background: #2980b9;
        }

        .footer {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 20px;
            text-align: center;
            color: #7f8c8d;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .key-anomaly-item {
            background: #fff3cd;
            border-radius: 8px;
            padding: 15px;
            margin: 10px 0;
            border-left: 4px solid #f39c12;
        }

        .key-anomaly-item h5 {
            color: #2c3e50;
            margin-bottom: 10px;
        }

        .progress-bar {
            width: 100%;
            height: 8px;
            background-color: #e9ecef;
            border-radius: 4px;
            margin-top: 10px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #f39c12, #e67e22);
            border-radius: 4px;
            transition: width 0.3s ease;
        }

        @media (max-width: 1200px) {
            .main-content.expanded {
                margin-right: 0;
            }
            
            .sidebar {
                width: 100%;
                max-width: 500px;
            }
        }
    </style>
</head>
<body>
    <div class="main-container">
        <!-- 主内容区域 -->
        <div class="main-content" id="mainContent">
            <!-- 头部信息 -->
            <div class="header">
                <h1>用户面信令分析报告</h1>
                <div class="subtitle">Falcomm自研团队</div>
                <div class="stats-grid">
                    <div class="stat-card">
                        <div class="stat-number">218</div>
                        <div class="stat-label">总数据包</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-number">9</div>
                        <div class="stat-label">DNS查询</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-number">14</div>
                        <div class="stat-label">TCP流</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-number">17</div>
                        <div class="stat-label">异常事件</div>
                    </div>
                </div>
            </div>

            <!-- 具体信令流程分析 -->
            <div class="analysis-section">
                <h2>具体信令流程分析</h2>
                <div class="signaling-flow-container">
        <div class="mermaid-diagram">
            <h3>网络信令流程图</h3>
            <div class="mermaid">
                sequenceDiagram
participant P1 as 10.227.149.29
participant P2 as 112.17.34.26
participant P3 as 112.17.34.27
participant P4 as 117.142.255.8
participant P5 as 183.240.129.180
participant P6 as 183.240.129.67

Note over P1,P2: DNS阶段 (正常)
P1->>P2: DNS查询 (UDP, packet16)
P2-->>P1: DNS响应 (UDP, packet17)
P1->>P1: DNS查询 (UDP, packet17)
P1-->>P1: DNS响应 (UDP, packet18)
P1->>P2: DNS查询 (UDP, packet20)
P2-->>P1: DNS响应 (UDP, packet21)
P1->>P1: DNS查询 (UDP, packet21)
P1-->>P1: DNS响应 (UDP, packet22)

Note over P1,P3: 建链阶段 (异常)
Note over P1,P2: 异常1: 持续重传, 未完成三次握手
P1->>P2: TCP请求 (packet1)
P1->>P2: TCP重传 (packet2) // 异常:无响应
Note over P1,P3: 异常2: 持续重传, 未完成三次握手
P1->>P3: TCP请求 (packet3)
P1->>P3: TCP重传 (packet4) // 异常:无响应

Note over P1,P4: 传输阶段 (异常)
Note over P3,P4: TCP传输异常
P1->>P2: TCP数据 (packet1)
Note over P3,P4: 下行延迟
P1->>P6: TCP数据 (packet2)
Note over P3,P4: 下行延迟
P6->>P1: TCP数据 (packet3)
Note over P3,P4: 下行延迟
P1->>P3: TCP数据 (packet4)
Note over P3,P4: 下行延迟

Note over P1,P3: ICMP传输 (异常)
P2->>P1: ICMP包 (packet87)
P1-->>P2: 目标主机强制禁止
P2->>P1: ICMP包 (packet91)
P1-->>P2: 目标主机强制禁止
            </div>
        </div>
        
        <div class="flow-phases">
            <h3>流程阶段分析</h3>
            <div class="phase-analysis">
                <div class="phase-item">
                    <h4>DNS阶段</h4>
                    <p>域名解析过程，包括DNS查询和响应</p>
                </div>
                <div class="phase-item">
                    <h4>建链阶段</h4>
                    <p>TCP连接建立过程，包括SYN、SYN-ACK、ACK</p>
                </div>
                <div class="phase-item">
                    <h4>传输阶段</h4>
                    <p>数据传输过程，包括数据包交换</p>
                </div>
                <div class="phase-item">
                    <h4>拆链阶段</h4>
                    <p>连接断开过程，包括FIN、ACK</p>
                </div>
            </div>
        </div>
        </div>
            </div>

            <!-- 信令流程分析图 -->
            <div class="analysis-section">
                <h2>信令流程分析图</h2>
                
        <div class="signaling-flow-diagram">
            <div class="flow-chart">
                <div class="flow-item">
                    <div class="flow-header">开始: 218个数据包</div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">DNS查询阶段 (9个查询) ✅ 正常</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常响应 (9个) → 建链阶段</div>
                        <div class="flow-branch">┗— 无异常</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">建链阶段 (14个TCP流)</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常连接 (10个) → 传输阶段</div>
                        <div class="flow-branch anomaly">┗— 连接失败 (4个) → TCP建链异常 ▲</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">传输阶段</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常传输 (1个)</div>
                        <div class="flow-branch anomaly">┗— 传输异常 (13个) → TCP传输异常 ▲</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">ICMP传输</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常传输</div>
                        <div class="flow-branch anomaly">┗— 传输异常 (0个) → ICMP传输异常 ▲</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">拆链阶段</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">正常结束</div>
                    </div>
                </div>
            </div>
            
            <div class="anomaly-summary">
                <h4>异常流程汇总</h4>
                <div class="anomaly-item">— TCP建链异常: 4个 (29%)</div>
                <div class="anomaly-item">— TCP传输异常: 13个 (93%)</div>
                <div class="anomaly-item">— ICMP传输异常: 0个 (0%)</div>
            </div>
        </div>
        
            </div>

            <!-- 网络流分析 -->
            <div class="analysis-section">
                <h2>网络流分析</h2>
                <div class="flows-container"><h3>TCP连接流</h3>
        <div class="flow-item">
            <h4>TCP_10.227.149.29:36452-112.17.34.26:8801</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 7</p>
                <p><strong>持续时间:</strong> 71.73秒</p>
                <p><strong>总字节:</strong> 518</p>
                <p><strong>状态:</strong> INCOMPLETE</p>
            </div>
        </div>
        
        <div class="flow-item">
            <h4>TCP_10.227.149.29:33578-183.240.129.67:8666</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 7</p>
                <p><strong>持续时间:</strong> 0.27秒</p>
                <p><strong>总字节:</strong> 462</p>
                <p><strong>状态:</strong> COMPLETE</p>
            </div>
        </div>
        
        <div class="flow-item">
            <h4>TCP_183.240.129.67:8666-10.227.149.29:33578</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 5</p>
                <p><strong>持续时间:</strong> 0.21秒</p>
                <p><strong>总字节:</strong> 288</p>
                <p><strong>状态:</strong> COMPLETE</p>
            </div>
        </div>
        
        <div class="flow-item">
            <h4>TCP_10.227.149.29:45910-112.17.34.27:8807</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 7</p>
                <p><strong>持续时间:</strong> 70.26秒</p>
                <p><strong>总字节:</strong> 518</p>
                <p><strong>状态:</strong> INCOMPLETE</p>
            </div>
        </div>
        
        <div class="flow-item">
            <h4>TCP_10.227.149.29:10014-183.240.129.76:8810</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 4</p>
                <p><strong>持续时间:</strong> 480.29秒</p>
                <p><strong>总字节:</strong> 220</p>
                <p><strong>状态:</strong> NO_CONNECTION</p>
            </div>
        </div>
        <h3>UDP数据流</h3>
        <div class="flow-item">
            <h4>UDP_221.177.56.146:2152-117.142.255.8:2152</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 66</p>
                <p><strong>持续时间:</strong> 822.27秒</p>
                <p><strong>总字节:</strong> 6983</p>
                <p><strong>状态:</strong> N/A</p>
            </div>
        </div>
        
        <div class="flow-item">
            <h4>UDP_10.227.149.29:41873-211.136.17.107:53</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 1</p>
                <p><strong>持续时间:</strong> 0.00秒</p>
                <p><strong>总字节:</strong> 75</p>
                <p><strong>状态:</strong> N/A</p>
            </div>
        </div>
        
        <div class="flow-item">
            <h4>UDP_211.136.17.107:53-10.227.149.29:41873</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 1</p>
                <p><strong>持续时间:</strong> 0.00秒</p>
                <p><strong>总字节:</strong> 95</p>
                <p><strong>状态:</strong> N/A</p>
            </div>
        </div>
        
        <div class="flow-item">
            <h4>UDP_117.142.255.8:2152-221.177.56.146:2152</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 43</p>
                <p><strong>持续时间:</strong> 659.66秒</p>
                <p><strong>总字节:</strong> 5207</p>
                <p><strong>状态:</strong> N/A</p>
            </div>
        </div>
        
        <div class="flow-item">
            <h4>UDP_10.227.149.29:54861-211.136.17.107:53</h4>
            <div class="flow-details">
                <p><strong>包数:</strong> 1</p>
                <p><strong>持续时间:</strong> 0.00秒</p>
                <p><strong>总字节:</strong> 81</p>
                <p><strong>状态:</strong> N/A</p>
            </div>
        </div>
        </div>
            </div>

            <!-- 异常检测结果 -->
            <div class="analysis-section">
                <h2>异常检测结果</h2>
                <div class="anomalies-container">
            <div class="anomaly-item" style="border-left-color: #e74c3c">
                <h4>TCP_CONNECTION_INCOMPLETE</h4>
                <p><strong>严重程度:</strong> HIGH</p>
                <p><strong>描述:</strong> TCP connection incomplete, potential connectivity issues</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:36452-112.17.34.26:8801</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 6 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:36452-112.17.34.26:8801</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 2 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:33578-183.240.129.67:8666</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 2 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_183.240.129.67:8666-10.227.149.29:33578</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #e74c3c">
                <h4>TCP_CONNECTION_INCOMPLETE</h4>
                <p><strong>严重程度:</strong> HIGH</p>
                <p><strong>描述:</strong> TCP connection incomplete, potential connectivity issues</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:45910-112.17.34.27:8807</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 6 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:45910-112.17.34.27:8807</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 1 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:10014-183.240.129.76:8810</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 1 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_183.240.129.76:8810-10.227.149.29:10014</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 1 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:35022-183.240.129.76:8808</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #e74c3c">
                <h4>TCP_CONNECTION_INCOMPLETE</h4>
                <p><strong>严重程度:</strong> HIGH</p>
                <p><strong>描述:</strong> TCP connection incomplete, potential connectivity issues</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:35804-112.17.34.26:8808</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 6 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:35804-112.17.34.26:8808</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 2 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:33592-183.240.129.67:8666</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 2 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_183.240.129.67:8666-10.227.149.29:33592</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #e74c3c">
                <h4>TCP_CONNECTION_INCOMPLETE</h4>
                <p><strong>严重程度:</strong> HIGH</p>
                <p><strong>描述:</strong> TCP connection incomplete, potential connectivity issues</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:46372-112.17.34.27:8808</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 6 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:46372-112.17.34.27:8808</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 2 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_10.227.149.29:57282-183.240.129.180:8666</p>
            </div>
            
            <div class="anomaly-item" style="border-left-color: #f39c12">
                <h4>TCP_RETRANSMISSION</h4>
                <p><strong>严重程度:</strong> MEDIUM</p>
                <p><strong>描述:</strong> Detected 2 TCP retransmission packets</p>
                <p><strong>影响流:</strong> TCP_183.240.129.180:8666-10.227.149.29:57282</p>
            </div>
            </div>
            </div>

            <!-- 性能统计 -->
            <div class="analysis-section">
                <h2>性能统计</h2>
                <div class="statistics-container"><h3>协议分布</h3><div class="protocol-chart"><div class="protocol-bar"><span>UDP</span><div class="bar" style="width: 10.9%"></div><span>109</span></div><div class="protocol-bar"><span>TCP</span><div class="bar" style="width: 7.7%"></div><span>77</span></div><div class="protocol-bar"><span>DNS</span><div class="bar" style="width: 1.8%"></div><span>18</span></div><div class="protocol-bar"><span>ICMP</span><div class="bar" style="width: 1.4%"></div><span>14</span></div></div><h3>性能统计</h3><p><strong>总持续时间:</strong> 822.27秒</p><p><strong>平均包间隔:</strong> 3.7893秒</p><p><strong>包率:</strong> 0.27 包/秒</p></div>
            </div>

            <!-- 页脚 -->
            <div class="footer">
                <p>用户面信令分析报告 | 生成时间: 2025-10-24 11:04:06</p>
                <p>Falcomm自研团队 | 总包数: 218 | 异常事件: 17</p>
            </div>
        </div>

        <!-- 右侧Sidebar -->
        <div class="sidebar collapsed" id="sidebar">
            <div class="sidebar-header">
                <h3>详细分析报告</h3>
                <p>点击右侧按钮展开/收起</p>
            </div>
            
            <div class="sidebar-content">
                <!-- 分析结论 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        分析结论
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        
        <div class="summary-content">
            <p><strong>总包数:</strong> 218</p>
            <p><strong>网络流数:</strong> 36</p>
            <p><strong>异常事件:</strong> 17</p>
            <p><strong>分析状态:</strong> 异常</p>
        </div>
        
                    </div>
                </div>

                <!-- 关键异常点 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        关键异常点
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <div class="key-anomalies-content">
            <div class="key-anomaly-item">
                <h5>TCP建链异常 (29%)</h5>
                <p><strong>类型:</strong> 连接失败</p>
                <p><strong>影响:</strong> 4个服务器</p>
                <div class="progress-bar">
                    <div class="progress-fill" style="width: 28.57142857142857%"></div>
                </div>
            </div>
            
            <div class="key-anomaly-item">
                <h5>TCP传输异常 (93%)</h5>
                <p><strong>类型:</strong> 下行延迟</p>
                <p><strong>影响:</strong> 13个传输流</p>
                <div class="progress-bar">
                    <div class="progress-fill" style="width: 92.85714285714286%"></div>
                </div>
            </div>
            </div>
                    </div>
                </div>

                <!-- 分析过程 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        分析过程
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常流程
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <div class="abnormal-process-content"><h5>1. 异常流程</h5><p>• 发现 4 个TCP连接未完成</p><p>  - TCP_10.227.149.29:46372-112.17.34.27:8808</p><p>  - TCP_10.227.149.29:35804-112.17.34.26:8808</p><p>  - TCP_10.227.149.29:45910-112.17.34.27:8807</p></div>
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常消息
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <div class="abnormal-message-content"><h5>2. 异常消息</h5><p>• 检测到 13 个TCP重传事件</p><p>• 网络传输存在丢包或延迟问题</p></div>
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常信元
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <div class="abnormal-element-content"><h5>3. 异常信元</h5><p>• 检查TCP标志位异常</p><p>• 检查序列号异常</p><p>• 检查窗口大小异常</p></div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 相关知识解释 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        相关知识解释
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常流程解释
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                
        <p>TCP连接建立需要三次握手：SYN、SYN-ACK、ACK。如果连接未完成，可能是网络问题、防火墙阻止或服务器不可达。</p>
        
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常消息解释
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                
        <p>TCP重传表示数据包丢失或延迟，可能由网络拥塞、链路质量差或超时设置不当导致。</p>
        
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常原因码解释
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                
        <p>• RST：连接被重置，通常表示服务不可用或连接被拒绝</p>
        <p>• FIN：正常关闭连接</p>
        <p>• SYN：连接建立请求</p>
        <p>• ACK：确认响应</p>
        
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 信元核查结果 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        信元核查结果
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <div class="field-check-content">
        <div class="signal-element-grid">
            <div class="signal-element-panel">
                <div class="signal-element-item">
                    <span class="checkmark">✅</span>
                    <span class="element-text">TCP信元</span>
                    <span class="status-text">格式正确</span>
                </div>
            </div>
            <div class="signal-element-panel">
                <div class="signal-element-item">
                    <span class="checkmark">✅</span>
                    <span class="element-text">ICMP信元</span>
                    <span class="status-text">格式正确</span>
                </div>
            </div>
            <div class="signal-element-panel">
                <div class="signal-element-item">
                    <span class="checkmark">✅</span>
                    <span class="element-text">DNS信元</span>
                    <span class="status-text">格式正确</span>
                </div>
            </div>
            <div class="signal-element-panel">
                <div class="signal-element-item">
                    <span class="element-text">异常原因</span>
                    <span class="status-text">网络层面</span>
                </div>
            </div>
        </div>
        
        <div class="verification-conclusion">
            <h5>核查结论</h5>
            <p>所有协议信元格式均正确，异常主要出现在网络层面而非协议层面。TCP连接失败、ICMP被禁止、DNS查询正常都表明网络策略或连通性问题。</p>
        </div>
        </div>
                    </div>
                </div>

                <!-- 处理建议 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        处理建议
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <div class="recommendation-item"><p>【投诉信息】白名单地址访问不了，请协助判断是否为服务器返回问题；112.17.34.26和112.17.34.27连不上，实际白名单为112.17.34.0/24。；涉及IP 112.17.34.26,112.17.34.27；白名单 112.17.34.0/24；APN CMMTMXYHZJY.JS；号码 1442257799497；投诉时间 2025-06-23 11:24；归属地 江苏。本次抓包显示 TCP 建链未完成 4 起、TCP 重传 13 起，主要涉及 112.17.34.26:8801、183.240.129.67:8666、10.227.149.29:33578 等目的端点；<span style="color:#e74c3c; font-weight:bold">为快速支撑投诉与处置，建议先在核心网/承载网侧对上述端点进行连通性核查（服务存活、端口放通、路由与NAT会话），重点比对抓包时段的防火墙/ACL命中与丢弃日志；若链路无异常但仍存在重传，建议临时放宽 SYN/RST 相关策略并回归测试，同时对拥塞与丢包进行观测，必要时调高会话超时与初始重传间隔，或评估链路带宽与队列策略优化。</span>上述处置完成后，安排一次同条件复现拨测并回收日志，结合Check TCP Connection Issues结果输出最终结论，用于与用户沟通和投诉判责。</p></div>
                    </div>
                </div>

                <!-- 问题原因及处理措施 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        问题原因及处理措施
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                TCP建链失败原因
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <div class="tcp-connection-failure-reasons"><h5>TCP建链失败原因</h5>
            <div class="solution-item">
                <p><strong>网络层面问题</strong></p>
                <p>• 目标服务器不可达或服务未启动</p>
                <p>• 防火墙阻止连接建立</p>
                <p>• 网络路由配置错误</p>
                <p>• 网络拥塞导致超时</p>
            </div>
            <div class="solution-item">
                <p><strong>协议层面问题</strong></p>
                <p>• TCP三次握手未完成</p>
                <p>• 序列号异常或窗口大小问题</p>
                <p>• 连接超时设置过短</p>
                <p>• 端口被占用或服务异常</p>
            </div>
            </div>
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                TCP传输延迟原因
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <div class="tcp-transmission-delay-reasons"><h5>TCP传输延迟原因</h5>
            <div class="solution-item">
                <p><strong>网络传输问题</strong></p>
                <p>• 网络拥塞导致数据包丢失</p>
                <p>• 链路质量差，误码率高</p>
                <p>• 网络设备处理能力不足</p>
                <p>• 带宽利用率过高</p>
            </div>
            <div class="solution-item">
                <p><strong>配置参数问题</strong></p>
                <p>• TCP超时设置不当</p>
                <p>• 重传机制配置错误</p>
                <p>• 窗口大小设置不合理</p>
                <p>• 拥塞控制算法不当</p>
            </div>
            </div>
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                ICMP被禁止原因
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <div class="icmp-forbidden-reasons"><h5>ICMP被禁止原因</h5>
            <div class="solution-item">
                <p><strong>ICMP策略说明</strong></p>
                <p>• ICMP协议被网络策略禁止</p>
                <p>• 可能影响网络诊断和故障排查</p>
                <p>• 建议根据业务需求调整ICMP策略</p>
            </div>
            </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 操作按钮 -->
                <div class="sidebar-section">
                    <h4>操作</h4>
                    <div style="text-align: center; padding: 15px;">
                        <button class="export-btn" onclick="printReport()">打印</button>
                        <button class="export-btn" onclick="saveAsHTML()">保存</button>
                    </div>
                </div>
            </div>
        </div>

        <!-- Sidebar切换按钮 -->
        <button class="sidebar-toggle" id="sidebarToggle" onclick="toggleSidebar()">
            展开报告
        </button>
    </div>

    <script>
// 初始化Mermaid
        mermaid.initialize({ startOnLoad: true });

        // Sidebar切换功能
        function toggleSidebar() {
            const sidebar = document.getElementById('sidebar');
            const mainContent = document.getElementById('mainContent');
            const toggleBtn = document.getElementById('sidebarToggle');
            
            if (sidebar.classList.contains('collapsed')) {
                sidebar.classList.remove('collapsed');
                mainContent.classList.add('expanded');
                toggleBtn.textContent = '收起报告';
            } else {
                sidebar.classList.add('collapsed');
                mainContent.classList.remove('expanded');
                toggleBtn.textContent = '展开报告';
            }
        }

        // Section切换功能
        function toggleSection(sectionElement) {
            const sectionContent = sectionElement.nextElementSibling;
            if (sectionContent && sectionContent.classList.contains('section-content')) {
                sectionContent.classList.toggle('expanded');
                const toggleBtn = sectionElement.querySelector('.section-toggle');
                if (toggleBtn) {
                    toggleBtn.textContent = sectionContent.classList.contains('expanded') ? '▼' : '▶';
                }
            }
        }

        // Sub-section切换功能
        function toggleSubSection(subItemElement) {
            const subContent = subItemElement.nextElementSibling;
            if (subContent && subContent.classList.contains('sub-content')) {
                subContent.classList.toggle('expanded');
                const subToggle = subItemElement.querySelector('.sub-toggle');
                if (subToggle) {
                    subToggle.textContent = subContent.classList.contains('expanded') ? '▼' : '▶';
                }
            }
        }

        // 打印报告
        function printReport() {
            window.print();
        }

        // 保存为HTML文件
        function saveAsHTML() {
            const htmlContent = document.documentElement.outerHTML;
            const blob = new Blob([htmlContent], { type: 'text/html' });
            const url = URL.createObjectURL(blob);
            const a = document.createElement('a');
            a.href = url;
            a.download = '用户面信令分析报告.html';
            document.body.appendChild(a);
            a.click();
            document.body.removeChild(a);
            URL.revokeObjectURL(url);
        }

        // 页面加载完成后初始化
        document.addEventListener('DOMContentLoaded', function() {
            // 默认关闭sidebar
            setTimeout(() => {
                // 不自动展开sidebar，保持关闭状态
            }, 1000);
        });
    </script>
</body>
</html>